<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head><link rel="stylesheet" href="${pageContext.request.contextPath}/static/easyui/bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/css/common/box.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/css/common/checkbox.css">

    <style type="text/css">
        a {
            color: black;
        }

        a:hover {
            text-decoration: none;
        }

        .bgc-w {
            background-color: #fff;
        }
        .block{
            display: inline-block;
            width: 20px;
        }
        .co{
            color: blue;
        }
        .bl{
            color: black;
        }
        .commen{
            cursor: pointer;
        }
    </style>
</head><body><div class="row" style="padding-top: 10px;">
    <div class="col-md-2">
        <h1 style="font-size: 24px; margin: 0;" class="">账号管理</h1>
    </div>
   <%-- <div class="col-md-10 text-right">
        <a href="${pageContext.request.contextPath}/admin/index/index.jsp"><span class="glyphicon glyphicon-home"></span> 首页</a> &gt; <a disabled="disabled">账号管理</a>
    </div>--%>
    <!--盒子头-->
    <div class="box-header">
        <h3 class="box-title">
            <a href="javascript:void(0)" class="label label-success" id="add_account" style="padding: 5px;position:relative;left:720px;">
                <span class="glyphicon glyphicon-plus"></span> 新增
            </a>
        </h3>
        <div class="box-tools">
            <div class="input-group" style="width: 150px;">
                <input type="text" class="form-control input-sm cha" placeholder="账号名查询">
                <div class="input-group-btn chazhao">
                    <a class="btn btn-sm btn-default"><span class="glyphicon glyphicon-search"></span></a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row" style="padding-top: 15px;">
    <div class="col-md-12" id="mail_account_body">
        <div class="bgc-w box box-primary thistable">
            <!--盒子身体-->
            <div class="box-body no-padding">
                <div class="table-responsive">
                    <table class="table table-hover table-striped">
                        <thead>
                        <tr>
                            <th scope="col" class="commen co">类型<span class="block"></span></th>
                            <th scope="col">账号名</th>
                            <th scope="col" class="co commen">创建时间<span class="block"></span></th>
                            <th scope="col" class="co commen">状态<span class="block"></span></th>
                            <th scope="col">操作</th>
                        </tr>
                        </thead>
                        <tbody class="update">
                            <tr>
                                <td><span>公司邮件</span></td>
                                <td><span>小刘</span></td>
                                <td><span>2017-9-25 18:47:35</span></td>
                                <td><span class="label label-success">有效</span>
                                </td>
                                <td><a href="addaccount?id=13" class="label xiugai">
                                    <span class="glyphicon glyphicon-edit"></span> 修改</a>
                                    <a onclick="{return confirm('删除该记录将不能恢复，确定删除吗？');};" href="dele?id=13" class="label shanchu">
                                        <span class="glyphicon glyphicon-remove"></span> 删除</a></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--盒子尾-->
            <div class="box-footer no-padding" style="margin-top: -20px;">
                <div style="padding: 5px;">
                    <div id="page" style="background: #fff; border: 0px; margin-top: 0px; padding: 2px; height: 25px;">
                        <div style="width: 40%; float: left;">
                            <div class="pageInfo" style="margin-left: 5px;">
                                共<span>9</span>条 | 每页<span>10</span>条
                                | 共<span>1</span>页
                            </div>
                        </div>
                        <div style="width: 60%; float: left;">
                            <div class="pageOperation">
                                <!--判断是否是第一页  -->
                                <a class="btn btn-sm btn-default no-padding tablefirst" disabled="disabled" style="width: 30px; height: 20px;">
                                    <span class="glyphicon glyphicon-backward"></span>
                                </a>
                                <a class="btn btn-sm btn-default no-padding tableup" disabled="disabled" style="width: 30px; height: 20px;">
                                    <span class="glyphicon glyphicon-triangle-left"></span>
                                </a>
                                <a disabled="disabled" class="btn btn-default no-padding" style="width: 30px; height: 20px;">
                                    1
                                </a>
                                <!--判断是否是最后一页  -->
                                <a class="btn btn-sm btn-default no-padding tabledown" disabled="disabled" style="width: 30px; height: 20px;">
                                    <span class="glyphicon glyphicon-triangle-right"></span>
                                </a>
                                <a class="btn btn-sm btn-default no-padding tablelast" disabled="disabled" style="width: 30px; height: 20px;">
                                    <span class="glyphicon glyphicon-forward"></span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
           <%-- <script>
                /* 分页插件按钮的点击事件 */
                /* url是从后台接收过来的链接，sort是记录排序规则 */
                $('.tablefirst').on('click',function(){
                    if(true==false){
                        $('.thistable').load('mailpaixu?page=0');
                    }
                });
                $('.tableup').on('click',function(){
                    if(true==false){
                        $('.thistable').load('mailpaixu?page=-1');
                    }
                });
                $('.tabledown').on('click',function(){
                    if(true==false){
                        $('.thistable').load('mailpaixu?page=1');
                    }
                });
                $('.tablelast').on('click',function(){
                    if(true==false){
                        $('.thistable').load('mailpaixu?page=0');
                    }

                });

                /*类型、状态、时间的排序  */
                $('.thistype').on('click', function() {
                    if ($(this).children().hasClass('glyphicon-triangle-bottom')) {
                        $('.thistable').load('mailpaixu?type=0&icon=glyphicon-triangle-top');
                    } else {
                        $('.thistable').load('mailpaixu?type=1&icon=glyphicon-triangle-bottom');
                    }
                });
                $('.thisstatus').on('click', function() {
                    if ($(this).children().hasClass('glyphicon-triangle-bottom')) {
                        $('.thistable').load('mailpaixu?status=0&icon=glyphicon-triangle-top');
                    } else {
                        $('.thistable').load('mailpaixu?status=1&icon=glyphicon-triangle-bottom');
                    }
                });
                $('.thistime').on('click', function() {
                    if ($(this).children().hasClass('glyphicon-triangle-bottom')) {
                        $('.thistable').load('mailpaixu?time=0&icon=glyphicon-triangle-top');
                    } else {
                        $('.thistable').load('mailpaixu?time=1&icon=glyphicon-triangle-bottom');
                    }
                });
                $('.thisvisit').on('click', function() {
                    if ($(this).children().hasClass('glyphicon-triangle-bottom')) {
                        $('.thistable').load('mailpaixu?visitnum=0&icon=glyphicon-triangle-top');
                    } else {
                        $('.thistable').load('mailpaixu?visitnum=1&icon=glyphicon-triangle-bottom');
                    }
                });
                /* 查找 */
                $('.baseKetsubmit').on('click', function() {
                    var baseKey = $('.baseKey').val();
                    console.log(baseKey);
                    $('.thistable').load('mailpaixu?baseKey='+baseKey+'');
                });
            </script>
            <script>

                $(function(){
                    $(".commen").click(function(){
                        var $val=$(this).text();
                        $(".thistable").load("mailpaixu",{val:$val});

                    });

                    $(".chazhao").click(function(){
                        var con=$(".cha").val();
                        $(".thistable").load("mailpaixu",{val:con});
                    });

                })
            </script>		--%>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        /*一进来就加载邮箱账号列表*/
        var pageNum = 1;
        var pageSize = 6;
        sendAjax(pageNum,pageSize);
        /*数据渲染*/
        function sendAjax(pageNum,pageSize) {
            $.ajax({
                async:true,
                url:"${pageContext.request.contextPath}/findMailAccount",
                type:"get",
                dataType:"json",
                data:{
                    pageNum:pageNum,
                    pageSize:pageSize,
                    mailAccountName:$(".cha").val()
                },
                success:function (result) {
                    var tableContent = "<div class=\"bgc-w box box-primary thistable\">\n" +
                        "            <!--盒子身体-->\n" +
                        "            <div class=\"box-body no-padding\">\n" +
                        "                <div class=\"table-responsive\">\n" +
                        "                    <table class=\"table table-hover table-striped\">\n" +
                        "                        <thead>\n" +
                        "                        <tr>\n" +
                        "                            <th scope=\"col\" class=\"commen co\">类型<span class=\"block\"></span></th>\n" +
                        "                            <th scope=\"col\">账号名</th>\n" +
                        "                            <th scope=\"col\" class=\"co commen\">创建时间<span class=\"block\"></span></th>\n" +
                        "                            <th scope=\"col\" class=\"co commen\">状态<span class=\"block\"></span></th>\n" +
                        "                            <th scope=\"col\">操作</th>\n" +
                        "                        </tr>\n" +
                        "                        </thead>\n" +
                        "                        <tbody class=\"update\">";
                    $.each(result.list,function (index,mailAccount) {
                        tableContent +=" <tr>\n" +
                            "                                <td><span>"+mailAccount.mailType+"</span></td>\n" +
                            "                                <td><span>"+mailAccount.mailAccountName+"</span></td>\n" +
                            "                                <td><span>"+mailAccount.mailCreateTime+"</span></td>\n" +
                            "                                <td><span class=\"label label-success\">"+(mailAccount.status == 1 ?"有效" : "无效")+"</span>\n" +
                            "                                </td>\n" +
                            "                                <td><a href=\"javascript:void(0)\" class=\"label xiugai\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-edit\" data-mail_account_id=\""+mailAccount.mailAccountId+"\" data-mail_account_num=\""+mailAccount.mailAccountNum+"\" data-mail_account_des=\""+mailAccount.mialDes+"\" data-mail_account_status=\""+mailAccount.status+"\" data-mail_account_name=\""+mailAccount.mailAccountName+"\" data-mail_account_pwd=\""+mailAccount.mailPwd+"\"></span> 修改</a>\n" +
                            "                                    <a href=\"javascript:void(0)\" class=\"label shanchu\">\n" +
                            "                                        <span class=\"glyphicon glyphicon-remove\" data-mail_account_id=\""+mailAccount.mailAccountId+"\"></span> 删除</a></td>\n" +
                            "                            </tr>";
                    })
                    tableContent +=" </tbody>\n" +
                        "                    </table>\n" +
                        "                </div>\n" +
                        "            </div>";

                    var pageContent = " <div class=\"box-footer no-padding\" style=\"margin-top: -20px;\">\n" +
                        "                <div style=\"padding: 5px;\">\n" +
                        "                    <div id=\"page\" style=\"background: #fff; border: 0px; margin-top: 0px; padding: 2px; height: 25px;\">\n" +
                        "                        <div style=\"width: 40%; float: left;\">\n" +
                        "                            <div class=\"pageInfo\" style=\"margin-left: 5px;\">\n" +
                        "                                共<span>"+result.total+"</span>条 | 每页<span>"+result.pageSize+"</span>条\n" +
                        "                                | 共<span>"+result.pages+"</span>页\n" +
                        "                            </div>\n" +
                        "                        </div>\n" +
                        "                        <div style=\"width: 60%; float: left;\">\n" +
                        "                            <div class=\"pageOperation\">";
                    //首页+上一页
                    if (result.pageNum == 1){
                        pageContent += "<a class=\"btn btn-sm btn-default no-padding tablefirst\" disabled=\"disabled\" title=\"1\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-backward\"></span>\n" +
                            "                                </a>\n" +
                            "                                <a class=\"btn btn-sm btn-default no-padding tableup\" disabled=\"disabled\" title=\"1\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-triangle-left\"></span>\n" +
                            "                                </a>";
                    }else{
                        pageContent += "<a class=\"btn btn-sm btn-default no-padding tablefirst\"  title=\"1\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-backward\"></span>\n" +
                            "                                </a>\n" +
                            "                                <a class=\"btn btn-sm btn-default no-padding tableup\"title=\""+result.prePage+"\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-triangle-left\"></span>\n" +
                            "                                </a>";
                    }
                    // 页码
                    for (let i = 1;i<=result.pages;i++){
                        if (result.pageNum == i){
                            pageContent += " <a disabled=\"disabled\" class=\"btn btn-default no-padding num\" title=\""+i+"\" style=\"width: 30px; height: 20px;\">\n" +
                                ""+i+"\n" +
                                "</a>";
                        }else{
                            pageContent += " <a class=\"btn btn-default no-padding num\" title=\""+i+"\" style=\"width: 30px; height: 20px;\">\n" +
                                ""+i+"\n" +
                                "</a>";
                        }
                    }
                    //下一页和尾页
                    if (result.pageNum == result.pages){
                        pageContent += " <a class=\"btn btn-sm btn-default no-padding tabledown\" disabled=\"disabled\" title=\""+result.pages+"\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-triangle-right\"></span>\n" +
                            "                                </a>\n" +
                            "                                <a class=\"btn btn-sm btn-default no-padding tablelast\" disabled=\"disabled\" title=\""+result.pages+"\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-forward\"></span>\n" +
                            "                                </a>";
                    } else{
                        pageContent += " <a class=\"btn btn-sm btn-default no-padding tabledown\"  title=\""+result.nextPage+"\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-triangle-right\"></span>\n" +
                            "                                </a>\n" +
                            "                                <a class=\"btn btn-sm btn-default no-padding tablelast\"  title=\""+result.pages+"\" style=\"width: 30px; height: 20px;\">\n" +
                            "                                    <span class=\"glyphicon glyphicon-forward\"></span>\n" +
                            "                                </a>";

                    }
                    tableContent += pageContent;
                    tableContent += "</div>\n" +
                        "                        </div>\n" +
                        "                    </div>\n" +
                        "                </div>\n" +
                        "            </div>\n" +
                        "        </div>";
                    $("#mail_account_body").html(tableContent);
                },
                error:function () {
                    alert("ajax请求失败！");
                }
            });
        };
       /*返回事件*/
        $(document).on("click","#goback",function () {
            sendAjax(pageNum,pageSize);
        });
        /*取消事件*/
        $(document).on("click","#cancel",function () {
            sendAjax(pageNum,pageSize);
        });
        /*分页数据渲染*/
        $(document).on("click",".pageOperation a",function () {
            sendAjax($(this).prop("title"),pageSize);
        });
        /*搜索按钮点击事件*/
        $(".chazhao").click(function () {
            sendAjax(pageNum,pageSize);
        })
        /*删除事件*/
        $(document).on("click",".shanchu",function () {
            if (confirm('删除该记录将不能恢复，确定删除吗？')){
                $.ajax({
                    async:true,
                    url:"${pageContext.request.contextPath}/removeMailAccount",
                    type:"get",
                    dadaType:"json",
                    data:{
                        mailAccountId:$(this).children("span").data("mail_account_id")
                    },
                    success:function (result) {
                        if (parseInt(result) > 0) {
                            alert("删除成功！");
                            sendAjax(1,6);
                        }else{
                            alert("删除失败！")
                        }
                    },
                    error:function () {
                        alert("ajax请求失败！");
                    }
                })
            }
        })
        /*修改事件*/
        $(document).on("click",".xiugai",function () {
            var mail_account_id = $(this).children(".glyphicon-edit").data("mail_account_id");
            var mail_account_num = $(this).children(".glyphicon-edit").data("mail_account_num");
            var mail_account_des = $(this).children(".glyphicon-edit").data("mail_account_des") == null? "" : $(this).children(".glyphicon-edit").data("mail_account_des");
            var mail_account_status = $(this).children(".glyphicon-edit").data("mail_account_status");
            var mail_account_name = $(this).children(".glyphicon-edit").data("mail_account_name");
            var mail_account_pwd = $(this).children(".glyphicon-edit").data("mail_account_pwd");
            var content = "";
            content += "<div class=\"bgc-w box\">\n" +
                "    <!--盒子头-->\n" +
                "    <div class=\"box-header\">\n" +
                "        <h3 class=\"box-title\">\n" +
                "            <a href=\"javascript:void(0);\" id=\"goback\" class=\"label label-default\" style=\"padding: 5px;\"> <i class=\"glyphicon glyphicon-chevron-left\"></i> <span>返回</span>\n" +
                "            </a>\n" +
                "        </h3>\n" +
                "    </div>\n" +
                "    <!--盒子身体-->\n" +
                "    <form>\n" +
                "        <div class=\"box-body no-padding\">\n" +
                "            <div class=\"box-body\">\n" +
                "                <!--錯誤信息提示  -->\n" +
                "                <div class=\"alert alert-danger alert-dismissable\" role=\"alert\" style=\"display: none;\">\n" +
                "                    错误信息:<button class=\"thisclose close\" type=\"button\">×</button>\n" +
                "                    <span class=\"error-mess\"></span>\n" +
                "                </div>\n" +
                "                <div class=\"row\">\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\"> <span>类型</span></label>\n" +
                "                        <select class=\"form-control\" name=\"mailType\" id=\"mailType\">\n" +
                "                            <option value=\"2\">公司邮件</option>\n" +
                "                        </select>\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">状态</label>\n" +
                "                        <select class=\"form-control\" name=\"status\" id=\"status\">\n";
            if (parseInt(mail_account_status) == 1){
                content +=   "                   <option value=\"1\" selected=\"selected\">有效</option>\n" +
                    "                            <option value=\"2\">无效</option>\n" ;
            } else{
                content +=   "                   <option value=\"1\">有效</option>\n" +
                    "                            <option value=\"2\" selected=\"selected\">无效</option>\n" ;
            }

            content += "                        </select>\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">名称</label>\n" +
                "                        <input name=\"accountName\" type=\"text\" id=\"account_Name\" class=\"form-control\" readonly=\"readonly\" value=\"猿来入此\" style=\"background-color:#fff;\">\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">发件昵称</label>\n" +
                "                        <input name=\"mailUserName\" type=\"text\" id=\"account_Name2\" class=\"form-control\" value=\""+mail_account_name+"\">\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">邮件账号</label>\n" +
                "                        <input class=\"form-control mail\" name=\"mailAccount\" id=\"mailAccount\" value=\""+mail_account_num+"\">\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\" style=\"position: relative;\">\n" +
                "                        <label class=\"control-label\">授权码</label>\n" +
                "                        <input class=\"form-control\" name=\"password\" id=\"password\" value=\""+mail_account_pwd+"\">\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">备注</label>\n" +
                "                        <textarea class=\"form-control text\" name=\"mailDes\" id=\"mailDes\">"+mail_account_des+"</textarea>\n" +
                "                        <input class=\"id\" name=\"mailNumberId\" id=\"mailNumberId\" value=\""+mail_account_id+"\" style=\"display:none;\">\n" +
                "                    </div>\n" +
                "                </div>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "        <!--盒子尾-->\n" +
                "        <div class=\"box-footer\">\n" +
                "            <button class=\"btn btn-primary\" id=\"update\" type=\"button\">修改</button>\n" +
                "            <button class=\"btn btn-default\" id=\"cancel\" type=\"button\">取消</button>\n" +
                "        </div>\n" +
                "    </form>\n" +
                "</div>"
            $("#mail_account_body").html(content);
        });
        /*修改保存事件*/
        $(document).on("click","#update",function () {
            var mail_account_id = $("#mailNumberId").val();
            var mail_account_num = $("#mailAccount").val();
            var mail_account_des = $("#mailDes").val();
            var mail_account_status = $("#status option:selected").val();
            var mail_account_name = $("#account_Name2").val();
            var mail_account_pwd = $("#password").val();
            var mail_account = {
                mailAccountId:mail_account_id,
                mailAccountNum:mail_account_num,
                mialDes:mail_account_des,
                mailAccountName:mail_account_name,
                mailPwd:mail_account_pwd,
                status:mail_account_status,
                mailCreateUserId:1
            }
            $.ajax({
                async:true,
                url:"${pageContext.request.contextPath}/updateMailAccount",
                type:"post",
                dataType:"json",
                contentType:"application/json",
                data:JSON.stringify(mail_account),
                success:function (result) {
                    if (parseInt(result) > 0) {
                        alert("修改成功！");
                        sendAjax(1,6);
                    }else{
                        alert("修改失败！")
                    }
                },
                error:function () {
                    alert("ajax请求失败！");
                }
            })
        })
        /*新增保存事件*/
        $(document).on("click","#save",function () {
            var mail_account_id = $("#mailNumberId").val();
            var mail_account_num = $("#mailAccount").val();
            var mail_account_des = $("#mailDes").val();
            var mail_account_status = $("#status option:selected").val();
            var mail_account_name = $("#account_Name2").val();
            var mail_account_pwd = $("#password").val();
            var mail_account = {
                mailAccountId:mail_account_id,
                mailAccountNum:mail_account_num,
                mialDes:mail_account_des,
                mailAccountName:mail_account_name,
                mailPwd:mail_account_pwd,
                status:mail_account_status,
                mailCreateUserId:1
            }
            $.ajax({
                async:true,
                url:"${pageContext.request.contextPath}/addMailAccount",
                type:"post",
                dataType:"json",
                contentType:"application/json",
                data:JSON.stringify(mail_account),
                success:function (result) {
                    if (parseInt(result) > 0) {
                        alert("增加成功！");
                        sendAjax(1,6);
                    }else{
                        alert("增加失败！")
                    }
                },
                error:function () {
                    alert("ajax请求失败！");
                }
            })
        })
        /*新增按钮点击事件*/
        function addAndUpdate(){
            $("#mail_account_body").html("<div class=\"bgc-w box\">\n" +
                "    <!--盒子头-->\n" +
                "    <div class=\"box-header\">\n" +
                "        <h3 class=\"box-title\">\n" +
                "            <a href=\"javascript:void(0);\" id=\"goback\" class=\"label label-default\" style=\"padding: 5px;\"> <i class=\"glyphicon glyphicon-chevron-left\"></i> <span>返回</span>\n" +
                "            </a>\n" +
                "        </h3>\n" +
                "    </div>\n" +
                "    <!--盒子身体-->\n" +
                "    <form>\n" +
                "        <div class=\"box-body no-padding\">\n" +
                "            <div class=\"box-body\">\n" +
                "                <!--錯誤信息提示  -->\n" +
                "                <div class=\"alert alert-danger alert-dismissable\" role=\"alert\" style=\"display: none;\">\n" +
                "                    错误信息:<button class=\"thisclose close\" type=\"button\">×</button>\n" +
                "                    <span class=\"error-mess\"></span>\n" +
                "                </div>\n" +
                "                <div class=\"row\">\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\"> <span>类型</span></label>\n" +
                "                        <select class=\"form-control\" name=\"mailType\" id=\"mailType\">\n" +
                "                            <option value=\"2\">公司邮件</option>\n" +
                "                        </select>\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">状态</label>\n" +
                "                        <select class=\"form-control\" name=\"status\" id=\"status\">\n" +
                "                            <option value=\"1\">有效</option>\n" +
                "                            <option value=\"2\">无效</option>\n" +
                "                        </select>\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">名称</label>\n" +
                "                        <input name=\"accountName\" type=\"text\" id=\"account_Name\" class=\"form-control\" readonly=\"readonly\" value=\"${sessionScope.accountMap.accountName}\" style=\"background-color:#fff;\">\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">发件昵称</label>\n" +
                "                        <input name=\"mailUserName\" type=\"text\" id=\"account_Name2\" class=\"form-control\" value=\"\">\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">邮件账号</label>\n" +
                "                        <input class=\"form-control mail\" name=\"mailAccount\" id=\"mailAccount\" value=\"\">\n" +
                "                    </div>\n" +
                "                    <div class=\"col-md-6 form-group\" style=\"position: relative;\">\n" +
                "                        <label class=\"control-label\">授权码</label>\n" +
                "                        <input class=\"form-control\" name=\"password\" id=\"password\" value=\"\">\n" +
                "                    </div>\n" +
                "\n" +
                "                    <div class=\"col-md-6 form-group\">\n" +
                "                        <label class=\"control-label\">备注</label>\n" +
                "                        <textarea class=\"form-control text\" name=\"mailDes\" id=\"mailDes\"></textarea>\n" +
                "                        <input class=\"id\" name=\"mailNumberId\" id=\"mailNumberId\" value=\"\" style=\"display:none;\">\n" +
                "                    </div>\n" +
                "                </div>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "        <!--盒子尾-->\n" +
                "        <div class=\"box-footer\">\n" +
                "            <button class=\"btn btn-primary\" id=\"save\" type=\"button\">保存</button>\n" +
                "            <button class=\"btn btn-default\" id=\"cancel\" type=\"button\">取消</button>\n" +
                "        </div>\n" +
                "    </form>\n" +
                "</div>");
        };
        /* 新增按钮事件*/
        $("#add_account").click(function (){
            addAndUpdate();
        });
    })

</script>

</body>
</html>